<template>
  <view class="certificate-info">
    <view class="info-row" v-for="(value, key) in certificateInfo" :key="key">
      <text class="label">{{ labels[key] }}</text>
      <text
        class="value"
        :class="{
          'service-commitment': key === 'serviceCommitment',
        }"
        :style="{ color: value === '有效' ? 'green' : '#0d1444' }"
      >
        {{ value }}
      </text>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    labels: {
      type: Object,
      required: true,
    },
    certificateInfo: {
      type: Object,
      required: true,
    },
  },
};
</script>

<style scoped lang="scss">
.certificate-info {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .info-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
    .value {
      &.service-commitment {
        height: 200px;
      }
    }
    .label {
      color: #79829c;
      font-size: 14px;
      line-height: 1.2;
    }

    .value {
      color: #0d1444;
      font-size: 14px;
    }
  }
}
</style>
